window.onload = function() {
    var xhr = new XMLHttpRequest()
    xhr.open('get','/album-list.json')
    xhr.onload = function() {
        var data = JSON.parse(this.responseText)
        var list = data.albumList
        var oContainer = document.querySelector('.container')
        for(var i in list){
            var a = list[i]
            var html = `<div class="album">
            <div class="cover-wrapper">
            <img  class="cover" src="${a.cover}"></div>
            <div class="title"><a href="/play.html?aid=${a.aid}">${a.title}</a></div>
            <div class="author">${a.username}</div>
            </div>`
            oContainer.innerHTML += html
        }
    }
    xhr.send()
}